﻿import java.util.Scanner;

public class code058 {
	public static void main(String[] args){
		int a,max = 0,min = 0;
		Scanner input=new Scanner(System.in);
		do {
			System.out.println("请输入一个整数(输入0结束)");
			a=input.nextInt();
			if(max<a){
				max=a;
			}else
				if(min<max&&min>=0){
					min=a;
				}
				}while(a!=0);
		System.out.println("最大值:"+max+"\t最小值:"+min);

	}
}